<!DOCTYPE HTML>
<html lang="en" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>js的使用 | Qin-BookNote</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.7">
        
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-search/search.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../../note/js/computer.html" />
    
    
    <link rel="prev" href="../../note/js/js.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="3.2"
        data-chapter-title="js的使用"
        data-filepath="note/js/use.md"
        data-basepath="../.."
        data-revision="Wed Sep 20 2017 11:13:21 GMT+0800 (中国标准时间)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
            

            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        Introduction
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" data-path="note/html/1.html">
            
                
                    <a href="../../note/html/1.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.</b>
                        
                        HTML
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="note/html/jianjie.html">
            
                
                    <a href="../../note/html/jianjie.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        HTML的简介和标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="note/html/emmet.html">
            
                
                    <a href="../../note/html/emmet.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        emmet
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="note/html/text.html">
            
                
                    <a href="../../note/html/text.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.3.</b>
                        
                        实体字符与文本
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="note/html/yuyi.html">
            
                
                    <a href="../../note/html/yuyi.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.4.</b>
                        
                        H5的语义化标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="note/html/biao.html">
            
                
                    <a href="../../note/html/biao.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.</b>
                        
                        表格
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="note/html/table.html">
            
                
                    <a href="../../note/html/table.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.1.</b>
                        
                        table表格
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="note/html/form.html">
            
                
                    <a href="../../note/html/form.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.2.</b>
                        
                        form表单
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="note/html/input.html">
            
                
                    <a href="../../note/html/input.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.5.3.</b>
                        
                        input属性
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="note/html/lianlie.html">
            
                
                    <a href="../../note/html/lianlie.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.</b>
                        
                        链接和列表
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="note/html/libiao.html">
            
                
                    <a href="../../note/html/libiao.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.1.</b>
                        
                        列表
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="note/html/lianjie.html">
            
                
                    <a href="../../note/html/lianjie.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.6.2.</b>
                        
                        超链接
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="note/html/media.html">
            
                
                    <a href="../../note/html/media.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.</b>
                        
                        多媒体
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="note/html/audio.html">
            
                
                    <a href="../../note/html/audio.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.7.1.</b>
                        
                        音频和视频
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="note/html/head.html">
            
                
                    <a href="../../note/html/head.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.8.</b>
                        
                        head
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="note/html/meta.html">
            
                
                    <a href="../../note/html/meta.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.8.1.</b>
                        
                        meta标签
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="note/html/link.html">
            
                
                    <a href="../../note/html/link.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.8.2.</b>
                        
                        link标签
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" data-path="note/css/css.html">
            
                
                    <a href="../../note/css/css.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.</b>
                        
                        CSS
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="note/css/xuanze.html">
            
                
                    <a href="../../note/css/xuanze.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        选择器
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.1" data-path="note/css/yuansu.html">
            
                
                    <a href="../../note/css/yuansu.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.1.</b>
                        
                        元素选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.1.2" data-path="note/css/csxuanze.html">
            
                
                    <a href="../../note/css/csxuanze.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.2.</b>
                        
                        关系选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.1.3" data-path="note/css/ziyuan.html">
            
                
                    <a href="../../note/css/ziyuan.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.3.</b>
                        
                        子元素选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.1.4" data-path="note/css/shuxing.html">
            
                
                    <a href="../../note/css/shuxing.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.4.</b>
                        
                        属性选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.1.5" data-path="note/css/weilei.html">
            
                
                    <a href="../../note/css/weilei.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.5.</b>
                        
                        伪类选择器
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.1.6" data-path="note/css/duixiang.html">
            
                
                    <a href="../../note/css/duixiang.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.6.</b>
                        
                        伪对象选择符
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="note/css/zi.html">
            
                
                    <a href="../../note/css/zi.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        字体
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.2.1" data-path="note/css/font.html">
            
                
                    <a href="../../note/css/font.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.1.</b>
                        
                        font
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2.2" data-path="note/css/icon.html">
            
                
                    <a href="../../note/css/icon.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.2.</b>
                        
                        icon
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2.3" data-path="note/css/wenben.html">
            
                
                    <a href="../../note/css/wenben.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.3.</b>
                        
                        文本装饰
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="note/css/biankuan.html">
            
                
                    <a href="../../note/css/biankuan.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        border
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.3.1" data-path="note/css/border.html">
            
                
                    <a href="../../note/css/border.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.1.</b>
                        
                        边框
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3.2" data-path="note/css/tu.html">
            
                
                    <a href="../../note/css/tu.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.2.</b>
                        
                        圆角与背景
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="note/css/hezi.html">
            
                
                    <a href="../../note/css/hezi.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        盒子模型
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.5" data-path="note/css/float.html">
            
                
                    <a href="../../note/css/float.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.5.</b>
                        
                        浮动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.6" data-path="note/css/position.html">
            
                
                    <a href="../../note/css/position.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.6.</b>
                        
                        定位
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.7" data-path="note/css/scss.html">
            
                
                    <a href="../../note/css/scss.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.7.</b>
                        
                        SCSS
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.8" data-path="note/css/donghua.html">
            
                
                    <a href="../../note/css/donghua.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.8.</b>
                        
                        动画
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.9" data-path="note/css/viewport.html">
            
                
                    <a href="../../note/css/viewport.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.9.</b>
                        
                        viewport
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.10" data-path="note/css/buju.html">
            
                
                    <a href="../../note/css/buju.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.10.</b>
                        
                        布局
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.11" data-path="note/css/rem.html">
            
                
                    <a href="../../note/css/rem.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.11.</b>
                        
                        rem的使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.12" data-path="note/css/shan.html">
            
                
                    <a href="../../note/css/shan.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.12.</b>
                        
                        响应式布局
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.13" data-path="note/css/flex.html">
            
                
                    <a href="../../note/css/flex.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.13.</b>
                        
                        flex
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" data-path="note/js/javascript.html">
            
                
                    <a href="../../note/js/javascript.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.</b>
                        
                        javascript解析器脚本
                    </a>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="note/js/js.html">
            
                
                    <a href="../../note/js/js.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        什么是js
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="3.2" data-path="note/js/use.html">
            
                
                    <a href="../../note/js/use.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        js的使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="note/js/computer.html">
            
                
                    <a href="../../note/js/computer.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        运算符
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="note/js/xunhuan.html">
            
                
                    <a href="../../note/js/xunhuan.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.</b>
                        
                        判断与循环
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="note/js/function.html">
            
                
                    <a href="../../note/js/function.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.5.</b>
                        
                        function函数
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="note/js/dom.html">
            
                
                    <a href="../../note/js/dom.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.6.</b>
                        
                        DOM
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="note/js/array.html">
            
                
                    <a href="../../note/js/array.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.7.</b>
                        
                        Array
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.8" data-path="note/js/math.html">
            
                
                    <a href="../../note/js/math.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.8.</b>
                        
                        Math
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.9" data-path="note/js/Date.html">
            
                
                    <a href="../../note/js/Date.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.9.</b>
                        
                        Date
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    Published with GitBook
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../" >Qin-BookNote</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="js&#x7684;&#x4F7F;&#x7528;">js&#x7684;&#x4F7F;&#x7528;</h1>
<h2 id="&#x8BED;&#x6CD5;">&#x8BED;&#x6CD5;</h2>
<ol>
<li>&#x53D8;&#x91CF;&#x9996;&#x5B57;&#x7B26;&#x5FC5;&#x987B;&#x4E3A;&#x5B57;&#x6BCD;&#x3001;&#x4E0B;&#x5212;&#x7EBF;_&#x3001;&#x7F8E;&#x5143;&#x7B26;$&#xFF0C;&#x4E09;&#x8005;&#x9009;&#x4E00;</li>
<li>&#x533A;&#x5206;&#x5927;&#x5C0F;&#x5199;</li>
<li>&#x53D8;&#x91CF;&#x540D;&#x6700;&#x597D;&#x5E26;&#x6709;&#x8BED;&#x4E49;</li>
<li>&#x4E0D;&#x80FD;&#x4F7F;&#x7528;&#x5173;&#x952E;&#x5B57;&#x548C;&#x4FDD;&#x7559;&#x5B57;</li>
<li>&#x53D8;&#x91CF;&#x540D;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x5927;&#x9A7C;&#x5CF0;&#x6216;&#x5C0F;&#x9A7C;&#x5CF0;&#x547D;&#x540D;&#x6CD5;<blockquote>
<p>&#x5982;&#x679C;&#x8FDD;&#x53CD;1&#xFF0C;2&#xFF0C;3&#x70B9;&#xFF0C;&#x4F1A;&#x89E6;&#x53D1;SyntaxError&#x8BED;&#x6CD5;&#x9519;&#x8BEF;
var &#x53EF;&#x4EE5;&#x5B9A;&#x4E49;&#x53D8;&#x91CF;&#x5BB9;&#x5668;&#x540C;&#x65F6;&#x5177;&#x6709;&#x201C;&#x63D0;&#x5347;&#x201D;&#x7684;&#x4F5C;&#x7528;&#xFF0C;&#x5C31;&#x662F;&#x628A;&#x53D8;&#x91CF;&#x7684;&#x5B9A;&#x4E49;&#x5168;&#x90E8;&#x7EDF;&#x4E00;&#x63D0;&#x524D;&#x5230;&#x7A0B;&#x5E8F;&#x7684;&#x6700;&#x5F00;&#x59CB;</p>
</blockquote>
</li>
</ol>
<h2 id="&#x53D8;&#x91CF;">&#x53D8;&#x91CF;</h2>
<p>&#x53EF;&#x53D8;&#x7684;&#x5BB9;&#x5668;&#x5C31;&#x53EB;&#x53D8;&#x91CF;</p>
<h2 id="&#x53D8;&#x91CF;&#x7684;&#x7C7B;&#x578B;">&#x53D8;&#x91CF;&#x7684;&#x7C7B;&#x578B;</h2>
<ol>
<li><p>&#x5B57;&#x7B26;&#x4E32;&#xFF08;String&#xFF09;
&#x7279;&#x5F81;&#xFF1A;&#x5F15;&#x53F7;&#x5305;&#x7740;&#x5185;&#x5BB9;&#xFF0C;&#x5355;&#x5F15;&#x53F7;&#x53CC;&#x5F15;&#x53F7;&#xFF08;ES5&#xFF09;&#xFF0C;&#x53CD;&#x5355;&#x5F15;&#x53F7;&#xFF08;ES6&#xFF09;
&#x53CD;&#x5355;&#x5F15;&#x53F7;&#xFF0C;&#x4E13;&#x95E8;&#x7528;&#x6765;&#x663E;&#x793A;&#x591A;&#x884C;&#x6587;&#x672C;&#xFF0C;&#x4F1A;&#x628A;&#x6574;&#x4E2A;&#x6587;&#x672C;&#x7684;&#x6240;&#x6709;&#x683C;&#x5F0F;&#x5B8C;&#x6574;&#x4FDD;&#x7559;&#x4E0B;&#x6765;,&#x5982;&#x679C;&#x8981;&#x663E;&#x793A;&#x8FD9;&#x4E9B;&#x7279;&#x6B8A;&#x7684;&#x7B26;&#x53F7;&#xFF0C;&#x9700;&#x8981;&#x7528;&#x4E0A;&#x53CD;&#x659C;&#x6760;\&#xFF08;&#x8868;&#x793A;&#x8F6C;&#x4E49;&#xFF09;
123\n123(\n&#x8868;&#x793A;&#x6362;&#x884C;)</p>
<pre><code>var content = `
&#x6211;&#x53EB;${name}
&#x54C8;&#x54C8;&#x54C8;,\$\{\},
&#x4ECA;&#x5929;&#x597D;&#x5927;&#x96E8;,
&#x53EF;&#x662F;&#x6211;&#x8FD8;&#x662F;&#x5230;&#x4E86;!
`
</code></pre></li>
<li><p>&#x6570;&#x503C;&#xFF08;Number&#xFF09;
Infinity &#x65E0;&#x9650;&#x5927;</p>
</li>
</ol>
<p>NaN         Not a Number   &#x4E0D;&#x662F;&#x4E00;&#x4E2A;&#x6570;
NaN&#x4E0E;NaN&#x6BD4;&#x8F83;&#xFF0C;&#x7ED3;&#x679C;&#x65F6;false</p>
<p>16&#x8FDB;&#x5236;&#x8868;&#x793A;&#x6570;&#x5B57;</p>
<p>&#x9690;&#x5F62;&#x8F6C;&#x6362;</p>
<ol>
<li>&#x5E03;&#x5C14;&#x503C;&#xFF08;Boolean&#xFF09;</li>
</ol>
<p>&#x53EA;&#x6709;&#x4FE9;&#x4E2A;&#x503C;true&#x548C;false
&#xFF08;0&#xFF0C;-0&#xFF0C;NaN&#xFF0C;undefined&#xFF0C;null&#xFF0C;&quot;&quot;&#xFF09;&#x90FD;&#x4F1A;&#x88AB;&#x8F6C;&#x6362;&#x4E3A;flase</p>
<ol>
<li>&#x7A7A;/&#x65E0;&#xFF08;undefined/unll&#xFF09;
null         &#x5565;&#x90FD;&#x6CA1;&#x6709;&#xFF0C;&#x8FDE;&#x4E2A;&#x76D2;&#x5B50;&#x90FD;&#x6CA1;&#x6709;
undefined    &#x6709;&#x4E2A;&#x76D2;&#x5B50;&#xFF0C;&#x4F46;&#x4E0D;&#x77E5;&#x9053;&#x8981;&#x88C5;&#x4EC0;&#x4E48;&#x4E1C;&#x897F;</li>
</ol>
<p>typeof &#x5224;&#x65AD;&#x53D8;&#x91CF;&#x7C7B;&#x578B;&#x7684;&#x65B9;&#x6CD5;
var new_arr = Object.prototype.toString.call(str1).slice(8,-1);//slice&#x5207;&#x526A;&#x7247;&#x6BB5;</p>
<p>&#xFF08;&#x4EE5;&#x4E0B;&#x662F;&#x590D;&#x6742;&#x7C7B;&#x578B;&#xFF09;</p>
<ol>
<li>&#x5BF9;&#x8C61;&#x7C7B;&#x578B;&#xFF08;Object&#xFF09;&#xFF08;&#x6700;&#x5927;&#x7684;&#x53D8;&#x91CF;&#xFF09;
&#x5C5E;&#x6027;&#x952E;&#x503C;&#x7684;&#x96C6;&#x5408;&#xFF0C;&#x8868;&#x793A;&#x5BF9;&#x8C61;&#x5177;&#x6709;&#x4EC0;&#x4E48;&#x6837;&#x7684;&#x5C5E;&#x6027;</li>
</ol>
<pre><code>    //&#x65B9;&#x6CD5;1    
    var Obj = new Object();
    Obj.name = &quot;BGG&quot;;
    console.log(Obj)
    //&#x65B9;&#x6CD5;2
    var obj = {
    &quot;name&quot;:&quot;bgg&quot;,
    &quot;age&quot;:18,
            }
</code></pre><p>&#x65B9;&#x6CD5;1&#xFF1A;&#x5148;&#x751F;&#x6210;&#x7A7A;&#x7684;&#x5BF9;&#x8C61;&#xFF0C;&#x7136;&#x540E;&#x518D;&#x7ED9;&#x5177;&#x4F53;&#x7684;&#x5C5E;&#x6027;&#x8D4B;&#x503C;</p>
<p>&#x65B9;&#x6CD5;2:&#x751F;&#x6210;&#x5BF9;&#x8C61;&#x7684;&#x540C;&#x65F6;&#xFF0C;&#x628A;&#x5C5E;&#x6027;&#x540D;&#x548C;&#x5C5E;&#x6027;&#x503C;&#x4E00;&#x8D77;&#x5B9A;&#x4E49;&#x8FDB;&#x53BB;
&#x5185;&#x5B58;&#x3002;&#x77ED;&#x6682;&#x7684;&#x5B58;&#x50A8;</p>
<pre><code>var obj1={
    &quot;name&quot;:&quot;bgg&quot;
        }
    var obj2;
    obj2 = obj1.name;
</code></pre><p>&#x4F20;&#x503C;or &#x4F20;&#x5730;&#x5740;
&#x9762;&#x53EA;&#x6709;&#x4E00;&#x4E2A;&#x5355;&#x95F4;&#x5C31;&#x662F;&#x4F20;&#x503C;&#xFF0C;&#x8FD8;&#x6709;&#x5176;&#x5B83;&#x7684;&#x5C31;&#x662F;&#x4F20;&#x5730;&#x5740;</p>
<pre><code>var room = {
    &quot;a&quot;:{
    &quot;a1&quot;:1,
    &quot;a2&quot;:2
        },
    &quot;b&quot;:{
    &quot;b1&quot;:3,
    &quot;b1&quot;:4,
    }
</code></pre><p>&#x53D8;&#x91CF;d &#x62F7;&#x8D1D; room&#x91CC;&#x9762;&#x5C5E;&#x6027;a
&#x56E0;&#x4E3A;&#x662F;room.a&#x662F;&#x4E2A;&#x5BF9;&#x8C61;&#xFF08;&#x590D;&#x6742;&#x7C7B;&#x578B;&#xFF09;&#xFF0C;&#x56E0;&#x6B64;&#x4ED6;&#x62F7;&#x8D1D;&#x7684;&#x662F;room.a&#x7684;&#x5730;&#x5740;&#x3002;</p>
<ol>
<li><p>&#x6570;&#x7EC4;&#x7C7B;&#x578B;&#xFF08;Array&#xFF09;
&#x5E26;&#x6709;&#x987A;&#x5E8F;&#x7684;&#x5C5E;&#x6027;&#x96C6;&#x5408;
var arr = new Array(1,2,3);</p>
</li>
<li><p>&#x51FD;&#x6570;&#x7C7B;&#x578B;&#xFF08;Function&#xFF09;
&#x4EE3;&#x7801;&#x7684;&#x96C6;&#x5408;&#x4F53;
var abc = new Function(&quot;a,b,c&quot;,&quot;return a+b+c&quot;);</p>
</li>
</ol>
<h2 id="&#x7C7B;&#x578B;&#x7684;&#x8F6C;&#x6362;">&#x7C7B;&#x578B;&#x7684;&#x8F6C;&#x6362;</h2>
<pre><code>var i = 10;                    //number
console.log(typeof i);
i = i.toString();
console.log(typeof i);        //String
</code></pre><p>&#x5B57;&#x7B26;&#x4E32;&#x8F6C;&#x6570;&#x503C;
parseInt &#x8F6C;&#x4E3A;&#x6574;&#x578B;&#x6570;&#x503C; parseFloat &#x8F6C;&#x4E3A;&#x6D6E;&#x70B9;&#x578B;&#x6570;&#x503C;</p>
<pre><code>i = new Number(10);
console.log(typeof i);        //number
parseInt&#xFF08;a,b&#xFF09;   a&#x4EE3;&#x8868;&#x6570;&#x503C;&#xFF0C;b&#x662F;&#x4EE3;&#x8868;&#x8F6C;&#x6362;&#x7684;&#x8FDB;&#x5236;
i = parseInt(0xff,10);//15*16&#x7684;&#x4E00;&#x6B21;&#x65B9;+15*16&#x7684;&#x96F6;&#x6B21;&#x65B9;=225
console.log(i);        //number
</code></pre><p>&#x7B80;&#x5355;&#x7C7B;&#x578B;&#x8DDF;&#x590D;&#x6742;&#x7C7B;&#x578B;&#x7684;&#x533A;&#x522B;
1.&#x7ED3;&#x6784;&#x6BD4;&#x8F83;&#x590D;&#x6742;&#xFF1B;
2.&#x8D4B;&#x503C;&#x7684;&#x9700;&#x8981;&#x627E;&#x5230;&#x5BF9;&#x5E94;&#x7684;&#x5C5E;&#x6027;&#x540D;</p>

                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../../note/js/js.html" class="navigation navigation-prev " aria-label="Previous page: 什么是js"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../../note/js/computer.html" class="navigation navigation-next " aria-label="Next page: 运算符"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../../gitbook/app.js"></script>

    
    <script src="../../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-search/search.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"anchor-navigation-ex":{"isRewritePageTitle":true,"isShowTocTitleIcon":true,"tocLevel1Icon":"fa fa-hand-o-right","tocLevel2Icon":"fa fa-hand-o-right","tocLevel3Icon":"fa fa-hand-o-right"},"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"livereload":{}};
    gitbook.start(config);
});
</script>

        
    </body>
    
</html>
